import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import SideView from '../views/homeChild/SideView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: 'home'
  },
  {
    path: '/login',
    name:'login',
    component:()=>import('../views/Rooter/LoginView.vue')
  },
  {
    path: '/htindex',
    name:'htindex',
    component:()=>import('../views/Rooter/Management/IndexView.vue'),
    redirect:"/htindex/indexlist",
    children:[
      {
        path:'indexlist',
        name:'indexlist',
        component:()=>import('../views/Rooter/sideview/IndexView.vue')
      },
      {
        path:'textht',
        name:'textht',
        component:()=>import('../views/Rooter/sideview/TextView.vue')
      },
      {
        path:'classifyht',
        name:'classifyht',
        component:()=>import('../views/Rooter/sideview/ClassifyView.vue')
      },
      {
        path:'taght',
        name:'taght',
        component:()=>import('../views/Rooter/sideview/TagView.vue')
      },
      {
        path:'blog',
        name:'blog',
        component:()=>import('../views/Rooter/sideview/BlogView.vue')
      },
    ]
  },
  {
    path: '/home',
    name: 'home',
    component:HomeView,
    
    redirect:'/home/index',
    children: [
      {
        path: 'index',
        name: 'index',
        components:{
         default: () => import('../views/homeChild/IndexView.vue'),
         SideView:SideView,
         Classify:() => import('../views/homeChild/ClassifyView.vue'),
         Tag: () => import('../views/homeChild/TagView.vue'),
        } 
      },
      {
        path: 'tag',
        name: 'tag',
        components:{
         default: () => import('../views/homeChild/TagView.vue'),
         SideView:SideView
        } 
      },
      {
        path: 'classify',
        name: 'classify',
         components:{
         default: () => import('../views/homeChild/ClassifyView.vue'),
         SideView:SideView
        } 
      },
      {
        path: 'archive',
        name: 'archive',
         components:{
         default: () => import('../views/homeChild/ArchiveView.vue'),
         SideView:SideView
        } 
      },
      {
        path: 'indexmore',
        name: 'indexmore',
         components:{
         default: () => import('../views/homeChild/IndexMore.vue'),
         SideView:SideView,
         
         Tag: () => import('../views/homeChild/TagView.vue'),
        } 
      },
      {
        path: 'classmore',
        name: 'classmore',
         components:{
         default: () => import('../views/homeChild/ClassView.vue'),
         SideView:SideView,
          Classify:() => import('../views/homeChild/ClassifyView.vue'),
         Tag: () => import('../views/homeChild/TagView.vue'),
        } 
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
